{if $act eq 'list'}
<table>
	<tr>
		<td>{$common.lan.goods_name}</td>
		<td>{$common.lan.expiration_time}</td>
		<td>{$common.lan.is_recommend}</td>
		<td>{$common.lan.is_new}</td>
		<td>{$common.lan.is_enable}</td>
		<td>{$common.lan.action}</td>
	</tr>
{foreach from=$data.list item=g}
	<tr>
		<td>{$g.goods_name}</td>
		<td>{'Y-m-d H:i:s'|date:$g.expiration_time}</td>
		<td>{if $g.is_recommend eq 1}{$common.lan.yes}{else}{$common.lan.no}{/if}</td>
		<td>{if $g.is_new eq 1}{$common.lan.yes}{else}{$common.lan.no}{/if}</td>
		<td>{if $g.is_enable eq 1}{$common.lan.is_enable_yes}{else}{$common.lan.is_enable_no}{/if}</td>
		<td>
		<a href="javascript:if(confirm('{$common.lan.confirm}{$common.lan.del}?')){ gotourl('goods.php?act=del&goods_id={$g.goods_id}', 'rightmain');}">{$common.lan.del}</a>
		<a href="javascript:gotourl('goods.php?act=edit&goods_id={$g.goods_id}', 'rightmain', '1');">{$common.lan.edit}</a>
		<a href="javascript:gotourl('goods.php?act=recommend&goods_id={$g.goods_id}', 'rightmain');">{if $g.is_recommend eq 1}{$common.lan.cancel}{$common.lan.recommend}{else}{$common.lan.recommend}{/if}</a>
		<a href="javascript:gotourl('goods.php?act=new&goods_id={$g.goods_id}', 'rightmain');">{if $g.is_new eq 1}{$common.lan.cancel}{$common.lan.new}{else}{$common.lan.new}{/if}</a>
		</td>
	</tr>
{/foreach}
</table>
{include file="lib/page.htm"}
{elseif $act eq 'add' or $act eq 'edit'}
<form action="goods.php?act={$act}submit" method="post" id="goodsinfo">
{if $act eq 'edit'}<input type="hidden" name="goods_id" value="{$goods.goods_id}" />{/if}
<div><h1>{$title}</h1></div>
<div id="goods_imglist">{if $act eq 'edit'}{foreach from=$goods.piclist item=pic}<img src="/images/{$pic.pic_url}" width="50" height="50" /><a href="javascript:if(confirm('{$common.lan.confirm}{$common.lan.del}')){ gotourl('goods.php?act=delpic&id={$pic.id}&goods_id={$pic.goods_id}', 'goods_imglist');}">del</a>{/foreach}{/if}</div>
<div>{$common.lan.goods_name}：<input type="text" name="goods_name" value="{if $act eq 'edit'}{$goods.goods_name}{/if}" /></div>
<div>{$common.lan.area_id}：{if $act eq 'edit'}{html_options name=area_id options=$common.goods_attr.area_list selected=$goods.area_id}{else}{html_options name=area_id options=$common.goods_attr.area_list}{/if}</div>
<div>{$common.lan.type_id}：{if $act eq 'edit'}{html_options name=type_id options=$common.goods_attr.type_list selected=$goods.type_id}{else}{html_options name=type_id options=$common.goods_attr.type_list}{/if}</div>
<div>{$common.lan.goods_price}：<input type="text" name="goods_price" value="{if $act eq 'edit'}{$goods.goods_price}{/if}" /></div>
<div>{$common.lan.models_id}：{if $act eq 'edit'}{html_options name=models_id options=$common.goods_attr.models_list selected=$goods.models_id}{else}{html_options name=models_id options=$common.goods_attr.models_list}{/if}</div>
<div>{$common.lan.condition_id}：{if $act eq 'edit'}{html_options name=condition_id options=$common.goods_attr.condition_list selected=$goods.condition_id}{else}{html_options name=condition_id options=$common.goods_attr.condition_list}{/if}</div>
<div>{$common.lan.displacement_id}：{if $act eq 'edit'}{html_options name=displacement_id options=$common.goods_attr.displacement_list selected=$goods.displacement_id}{else}{html_options name=displacement_id options=$common.goods_attr.displacement_list}{/if}</div>
<div>{$common.lan.color_id}：{if $act eq 'edit'}{html_options name=color_id options=$common.goods_attr.color_list selected=$goods.color_id}{else}{html_options name=color_id options=$common.goods_attr.color_list}{/if}</div>
<div>{$common.lan.buy_year}：{if $act eq 'edit'}{html_options name=buy_year options=$common.goods_attr.buy_year_list selected=$goods.buy_year}{else}{html_options name=buy_year options=$common.goods_attr.buy_year_list}{/if}</div>
<div>{$common.lan.mileage_id}：{if $act eq 'edit'}{html_options name=mileage_id options=$common.goods_attr.mileage_list selected=$goods.mileage_id}{else}{html_options name=mileage_id options=$common.goods_attr.mileage_list}{/if}公里</div>
<div>{$common.lan.goods_info}：<textarea id="goods_info" name="goods_info">{if $act eq 'edit'}{$goods.goods_info}{/if}</textarea></div>
<div>{$common.lan.phone}：<input type="text" name="phone" value="{if $act eq 'edit'}{$goods.phone}{/if}" /></div>
<div>{$common.lan.contact}：<input type="text" name="contact" value="{if $act eq 'edit'}{$goods.contact}{/if}" /></div>
<div>{$common.lan.qq_msn}：<input type="text" name="qq_msn" value="{if $act eq 'edit'}{$goods.qq_msn}{/if}" /></div>
<div>{$common.lan.is_enable}：{if $act eq 'edit'}{html_options name=is_enable options=$common.goods_attr.is_enable selected=$goods.is_enable}{else}{html_options name=is_enable options=$common.goods_attr.is_enable}{/if}</div>
<div>{$common.lan.expiration_time}：<input type="text" name="expiration_time" value="{if $act eq 'add'}30{else}{$goods.expiration_time}{/if}" /></div>
<div>
{if $tempimglist}{$common.lan.temp}{$common.lan.pic}：{/if}
	<div id="imglist">
	{foreach from=$tempimglist item=img}
		<div style="display:inline;">
			<input name="piclist[]" type="checkbox" checked="checked" value="{$img.id}" />
			<img src="/images/{$img.pic_url}" width="50" height="50" />
			<a href="javascript:if(confirm('{$common.lan.confirm}{$common.lan.del}')){ gotourl('goods.php?act=delpic&id={$img.id}&goods_id={$img.goods_id}', 'imglist');}">del</a>
		</div>
	{/foreach}
	</div>
</div>
</form>
<iframe name="ajaxifr" style="display:none;"></iframe>
<div id="loading" style="display:none;">loading...</div>
<form method="post" enctype="multipart/form-data" action="/admin/uploadify.php" target="ajaxifr" id="uploadimgform">
{$common.lan.temp}{$common.lan.pic}：
<div>
	<a href="javascript:adduploadpic();">+</a><input type="file" size="45" name="fileToUpload[]" class="input">
	<input type="button" name="mysubmit" value="Upload" onclick="uploadimg()" />
</div>
<div  id="uppicform"></div>
</form>
<div><input type="button" value="{$common.lan.submit}" id="form_submit" formid="goodsinfo" dispid="rightmain" onclick="$.getScript('/static/js/form_submit.js')" /></div>
{/if}